import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/overall",
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/overall",
        name: "OverAll",
        component: () => import("../views/visualization/OverAll.vue"),
      },
      {
        path: "/course-graph",
        name: "CourseGraph",
        component: () => import("../views/visualization/CourseGraph.vue"),
        redirect: "/course-graph/teaching-graph",
        children: [
          {
            path: "teaching-graph",
            name: "CourseTeachingGraph",
            component: () =>
              import("../views/visualization/courseGraph/TeachingGraph.vue"),
          },
          {
            path: "knowledge-graph",
            name: "CourseKnowledgeGraph",
            component: () =>
              import("../views/visualization/courseGraph/KnowledgeGraph.vue"),
          },
        ],
      },
      {
        path: "/lesson-graph",
        name: "LessonGraph",
        component: () => import("../views/visualization/LessonGraph.vue"),
        redirect: "/lesson-graph/teaching-graph",
        children: [
          {
            path: "analysis-details",
            name: "LessonAnalysisDetails",
            component: () =>
              import(
                "../views/visualization/lessonGraph/LessonAnalysisDetails.vue"
              ),
          },
          {
            path: "teaching-graph",
            name: "LessonTeachingGraph",
            component: () =>
              import("../views/visualization/lessonGraph/TeachingGraph.vue"),
          },
        ],
      },
    ],
  },
  {
    path: "/analysis-manage",
    name: "AnalysisManage",
    component: () => import("../views/analysisManage/Index.vue"),
    children: [
      {
        path: "/analysis-task-manage",
        name: "AnalysisTaskManage",
        component: () =>
          import("../views/analysisManage/AnalysisTaskManage.vue"),
      },
      {
        path: "/lib-manage",
        name: "LibManage",
        component: () => import("../views/analysisManage/LibManage.vue"),
      },
      {
        path: "/knowledge-relationship-manage",
        name: "KnowledgeRelationManage",
        component: () =>
          import(
            "../views/analysisManage/knowledgeAnalysisManage/KnowledgeRelationship.vue"
          ),
      },
      {
        path: "/knowledge-lib-manage",
        name: "KnowledgeLibManage",
        component: () =>
          import(
            "../views/analysisManage/knowledgeAnalysisManage/KnowledgeLib.vue"
          ),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
